\hypertarget{a00103}{}\section{E\+:/knet-\/git/knet/knet/timer.h 文件参考}
\label{a00103}\index{E\+:/knet-\/git/knet/knet/timer.\+h@{E\+:/knet-\/git/knet/knet/timer.\+h}}
{\ttfamily \#include \char`\"{}config.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}timer\+\_\+api.\+h\char`\"{}}\\*
\subsection*{函数}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{a00103_af64f93b32c31cd222c02f0ad40bb642c_af64f93b32c31cd222c02f0ad40bb642c}{ktimer\+\_\+destroy} (\hyperlink{a00056_a846172ea4e8a86449eca41a3d8e074b7_a846172ea4e8a86449eca41a3d8e074b7}{ktimer\+\_\+t} $\ast$timer)
\begin{DoxyCompactList}\small\item\em 销毁定时器 \end{DoxyCompactList}\item 
int \hyperlink{a00103_a6e263963404ff40c8d7865ba117d3446_a6e263963404ff40c8d7865ba117d3446}{ktimer\+\_\+check\+\_\+timeout} (\hyperlink{a00056_a846172ea4e8a86449eca41a3d8e074b7_a846172ea4e8a86449eca41a3d8e074b7}{ktimer\+\_\+t} $\ast$timer, time\+\_\+t ms)
\begin{DoxyCompactList}\small\item\em 检查定时器是否超时 \end{DoxyCompactList}\item 
void \hyperlink{a00103_a03cfe3f98b0537ccb1aba830ccee3991_a03cfe3f98b0537ccb1aba830ccee3991}{ktimer\+\_\+set\+\_\+current\+\_\+list} (\hyperlink{a00056_a846172ea4e8a86449eca41a3d8e074b7_a846172ea4e8a86449eca41a3d8e074b7}{ktimer\+\_\+t} $\ast$timer, \hyperlink{a00056_ae098586334a621a23cef7cb17590b618_ae098586334a621a23cef7cb17590b618}{kdlist\+\_\+t} $\ast$list)
\begin{DoxyCompactList}\small\item\em 设置定时器所在的当前链表 \end{DoxyCompactList}\item 
\hyperlink{a00056_ae098586334a621a23cef7cb17590b618_ae098586334a621a23cef7cb17590b618}{kdlist\+\_\+t} $\ast$ \hyperlink{a00103_a189b9239e148c4eeec1ec910261a3389_a189b9239e148c4eeec1ec910261a3389}{ktimer\+\_\+get\+\_\+current\+\_\+list} (\hyperlink{a00056_a846172ea4e8a86449eca41a3d8e074b7_a846172ea4e8a86449eca41a3d8e074b7}{ktimer\+\_\+t} $\ast$timer)
\begin{DoxyCompactList}\small\item\em 取得当前所属链表 \end{DoxyCompactList}\item 
void \hyperlink{a00103_a10748c7e8540fef8a8948da8662f7889_a10748c7e8540fef8a8948da8662f7889}{ktimer\+\_\+set\+\_\+current\+\_\+list\+\_\+node} (\hyperlink{a00056_a846172ea4e8a86449eca41a3d8e074b7_a846172ea4e8a86449eca41a3d8e074b7}{ktimer\+\_\+t} $\ast$timer, \hyperlink{a00056_ac701f00a0851c97467ae35c382b316b7_ac701f00a0851c97467ae35c382b316b7}{kdlist\+\_\+node\+\_\+t} $\ast$node)
\begin{DoxyCompactList}\small\item\em 设置定时器所在的当前链表的链表节点 \end{DoxyCompactList}\item 
\hyperlink{a00056_ac701f00a0851c97467ae35c382b316b7_ac701f00a0851c97467ae35c382b316b7}{kdlist\+\_\+node\+\_\+t} $\ast$ \hyperlink{a00103_a6c3c91cc707a108fc5e01e441bc3513e_a6c3c91cc707a108fc5e01e441bc3513e}{ktimer\+\_\+get\+\_\+current\+\_\+list\+\_\+node} (\hyperlink{a00056_a846172ea4e8a86449eca41a3d8e074b7_a846172ea4e8a86449eca41a3d8e074b7}{ktimer\+\_\+t} $\ast$timer)
\begin{DoxyCompactList}\small\item\em 取得当前链表节点 \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{函数说明}
\hypertarget{a00103_a6e263963404ff40c8d7865ba117d3446_a6e263963404ff40c8d7865ba117d3446}{}\index{timer.\+h@{timer.\+h}!ktimer\+\_\+check\+\_\+timeout@{ktimer\+\_\+check\+\_\+timeout}}
\index{ktimer\+\_\+check\+\_\+timeout@{ktimer\+\_\+check\+\_\+timeout}!timer.\+h@{timer.\+h}}
\subsubsection[{ktimer\+\_\+check\+\_\+timeout}]{\setlength{\rightskip}{0pt plus 5cm}int ktimer\+\_\+check\+\_\+timeout (
\begin{DoxyParamCaption}
\item[{{\bf ktimer\+\_\+t} $\ast$}]{timer, }
\item[{time\+\_\+t}]{ms}
\end{DoxyParamCaption}
)}\label{a00103_a6e263963404ff40c8d7865ba117d3446_a6e263963404ff40c8d7865ba117d3446}


检查定时器是否超时 


\begin{DoxyParams}{参数}
{\em timer} & ktimer\+\_\+t实例 \\
\hline
{\em ms} & 当前时间戳 \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{返回值}
{\em 0} & 没有超时 \\
\hline
{\em 非零} & 超时 \\
\hline
\end{DoxyRetVals}
\hypertarget{a00103_af64f93b32c31cd222c02f0ad40bb642c_af64f93b32c31cd222c02f0ad40bb642c}{}\index{timer.\+h@{timer.\+h}!ktimer\+\_\+destroy@{ktimer\+\_\+destroy}}
\index{ktimer\+\_\+destroy@{ktimer\+\_\+destroy}!timer.\+h@{timer.\+h}}
\subsubsection[{ktimer\+\_\+destroy}]{\setlength{\rightskip}{0pt plus 5cm}void ktimer\+\_\+destroy (
\begin{DoxyParamCaption}
\item[{{\bf ktimer\+\_\+t} $\ast$}]{timer}
\end{DoxyParamCaption}
)}\label{a00103_af64f93b32c31cd222c02f0ad40bb642c_af64f93b32c31cd222c02f0ad40bb642c}


销毁定时器 


\begin{DoxyParams}{参数}
{\em timer} & ktimer\+\_\+t实例 \\
\hline
\end{DoxyParams}
\hypertarget{a00103_a189b9239e148c4eeec1ec910261a3389_a189b9239e148c4eeec1ec910261a3389}{}\index{timer.\+h@{timer.\+h}!ktimer\+\_\+get\+\_\+current\+\_\+list@{ktimer\+\_\+get\+\_\+current\+\_\+list}}
\index{ktimer\+\_\+get\+\_\+current\+\_\+list@{ktimer\+\_\+get\+\_\+current\+\_\+list}!timer.\+h@{timer.\+h}}
\subsubsection[{ktimer\+\_\+get\+\_\+current\+\_\+list}]{\setlength{\rightskip}{0pt plus 5cm}{\bf kdlist\+\_\+t}$\ast$ ktimer\+\_\+get\+\_\+current\+\_\+list (
\begin{DoxyParamCaption}
\item[{{\bf ktimer\+\_\+t} $\ast$}]{timer}
\end{DoxyParamCaption}
)}\label{a00103_a189b9239e148c4eeec1ec910261a3389_a189b9239e148c4eeec1ec910261a3389}


取得当前所属链表 


\begin{DoxyParams}{参数}
{\em timer} & ktimer\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
kdlist\+\_\+t实例 
\end{DoxyReturn}
\hypertarget{a00103_a6c3c91cc707a108fc5e01e441bc3513e_a6c3c91cc707a108fc5e01e441bc3513e}{}\index{timer.\+h@{timer.\+h}!ktimer\+\_\+get\+\_\+current\+\_\+list\+\_\+node@{ktimer\+\_\+get\+\_\+current\+\_\+list\+\_\+node}}
\index{ktimer\+\_\+get\+\_\+current\+\_\+list\+\_\+node@{ktimer\+\_\+get\+\_\+current\+\_\+list\+\_\+node}!timer.\+h@{timer.\+h}}
\subsubsection[{ktimer\+\_\+get\+\_\+current\+\_\+list\+\_\+node}]{\setlength{\rightskip}{0pt plus 5cm}{\bf kdlist\+\_\+node\+\_\+t}$\ast$ ktimer\+\_\+get\+\_\+current\+\_\+list\+\_\+node (
\begin{DoxyParamCaption}
\item[{{\bf ktimer\+\_\+t} $\ast$}]{timer}
\end{DoxyParamCaption}
)}\label{a00103_a6c3c91cc707a108fc5e01e441bc3513e_a6c3c91cc707a108fc5e01e441bc3513e}


取得当前链表节点 


\begin{DoxyParams}{参数}
{\em timer} & ktimer\+\_\+t实例 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{返回}
kdlist\+\_\+node\+\_\+t实例 
\end{DoxyReturn}
\hypertarget{a00103_a03cfe3f98b0537ccb1aba830ccee3991_a03cfe3f98b0537ccb1aba830ccee3991}{}\index{timer.\+h@{timer.\+h}!ktimer\+\_\+set\+\_\+current\+\_\+list@{ktimer\+\_\+set\+\_\+current\+\_\+list}}
\index{ktimer\+\_\+set\+\_\+current\+\_\+list@{ktimer\+\_\+set\+\_\+current\+\_\+list}!timer.\+h@{timer.\+h}}
\subsubsection[{ktimer\+\_\+set\+\_\+current\+\_\+list}]{\setlength{\rightskip}{0pt plus 5cm}void ktimer\+\_\+set\+\_\+current\+\_\+list (
\begin{DoxyParamCaption}
\item[{{\bf ktimer\+\_\+t} $\ast$}]{timer, }
\item[{{\bf kdlist\+\_\+t} $\ast$}]{list}
\end{DoxyParamCaption}
)}\label{a00103_a03cfe3f98b0537ccb1aba830ccee3991_a03cfe3f98b0537ccb1aba830ccee3991}


设置定时器所在的当前链表 


\begin{DoxyParams}{参数}
{\em timer} & ktimer\+\_\+t实例 \\
\hline
{\em list} & 链表 \\
\hline
\end{DoxyParams}
\hypertarget{a00103_a10748c7e8540fef8a8948da8662f7889_a10748c7e8540fef8a8948da8662f7889}{}\index{timer.\+h@{timer.\+h}!ktimer\+\_\+set\+\_\+current\+\_\+list\+\_\+node@{ktimer\+\_\+set\+\_\+current\+\_\+list\+\_\+node}}
\index{ktimer\+\_\+set\+\_\+current\+\_\+list\+\_\+node@{ktimer\+\_\+set\+\_\+current\+\_\+list\+\_\+node}!timer.\+h@{timer.\+h}}
\subsubsection[{ktimer\+\_\+set\+\_\+current\+\_\+list\+\_\+node}]{\setlength{\rightskip}{0pt plus 5cm}void ktimer\+\_\+set\+\_\+current\+\_\+list\+\_\+node (
\begin{DoxyParamCaption}
\item[{{\bf ktimer\+\_\+t} $\ast$}]{timer, }
\item[{{\bf kdlist\+\_\+node\+\_\+t} $\ast$}]{node}
\end{DoxyParamCaption}
)}\label{a00103_a10748c7e8540fef8a8948da8662f7889_a10748c7e8540fef8a8948da8662f7889}


设置定时器所在的当前链表的链表节点 


\begin{DoxyParams}{参数}
{\em timer} & ktimer\+\_\+t实例 \\
\hline
{\em node} & 链表节点 \\
\hline
\end{DoxyParams}
